|
|
@@ -179,7 +179,9 @@ class AgentsController < ApplicationController
|
179
|
179
|
|
180
|
180
|
# Sanitize params[:return] to prevent open redirect attacks, a common security issue.
|
181
|
181
|
def redirect_back(message)
|
182
|
|
- if params[:return] == "show" && @agent
|
|
182
|
+ if params[:return] == "show" && message.include?("deleted")
|
|
183
|
+ path = agents_path
|
|
184
|
+ elsif params[:return] == "show" && @agent
|
183
|
185
|
path = agent_path(@agent)
|
184
|
186
|
elsif params[:return] =~ /\A#{Regexp::escape scenarios_path}\/\d+\Z/
|
185
|
187
|
path = params[:return]
|